//index.js
//先导入 再引入
const {getHomeHttp} = require("../../module/http")
Page({
  data:{
    programs:[]
  },
  onLoad:async function(){
     var res = await getHomeHttp();
     var playlists =[];
     res.data.programs.forEach(item=>{
       console.log(item);
       let {name,coverUrl,id} = item;
       playlists.push({
         name,
         coverImgUrl:coverUrl,
          id,
       })
     })
     this.setData({
       playlists
     })
  }
})
